package com.example.myapplication;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {


    Button btn1, btn2, btn3;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        init();
    }

    private void init() {
        btn1 = findViewById(R.id.btn1);
        btn2 = findViewById(R.id.btn2);
        btn3 = findViewById(R.id.btn3);
        btn1.setOnClickListener(this);
        btn2.setOnClickListener(this);
        btn3.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn1:
                //属性动画
                startActivity(new Intent(MainActivity.this, ObjectAnimatorActivity.class));
                break;
            case R.id.btn2:
                //组合动画
                startActivity(new Intent(MainActivity.this, AnimatorSetActivity.class));
                break;
            case R.id.btn3:
                startActivity(new Intent(MainActivity.this, SpringAnimationActivity.class));
                break;
        }
    }
}
